package com;

import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

import java.util.Iterator;

/**
 * Created by lzx on 16/7/8.
 */
@SpringBootApplication
//@EnableAspectJAutoProxy(proxyTargetClass = true)
public class Application  implements CommandLineRunner {
    /**
     * 覆写这个方法并继承上面的类的作用是可以将springboot项目部署到tomcat容器中运行
     * @return
     */
//    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder){
//        return builder.sources(Application.class);
//    }

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(Application.class,args);
        Iterator<String> iterator = context.getBeanFactory().getBeanNamesIterator();
        while (iterator.hasNext()){
//            System.out.println(iterator.next());
        }
    }

    @Override
    public void run(String... strings) throws Exception {
    }


}
